package Generics;
class MyArray<T> {
    public Object[] array = new Object[5];

    public void set(int index, T value) {
        array[index] = value;
    }

    public T get(int index) {
        return (T)array[index];
    }
}
public class TestGenerics {
    public static void main(String[] args) {
        MyArray<String> myArray = new MyArray<>();
        myArray.set(0,"my name");
        myArray.set(1,"halo");
        System.out.println(myArray.get(0)+myArray.get(1));
    }
}
